<template>
  <QualityStandardManager standard-type="finished" />
</template>

<script setup lang="ts">
import QualityStandardManager from '@/components/QualityStandardManager.vue'
</script>

<style lang="scss" scoped>
/* 页面容器样式 */
.page-container {
  min-height: 100%;
  box-sizing: border-box;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  background: #fff;
  transition: all 0.3s ease;
  overflow: hidden;

  /* 页面头部样式 */
  .header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 20px;
    font-weight: 600;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 18px 24px;
    border-radius: 12px 12px 0 0;
    margin: -20px -20px 24px -20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    
    &::before {
      content: '';
      position: absolute;
      top: -50%;
      left: -50%;
      width: 200%;
      height: 200%;
      background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 70%);
      opacity: 0.6;
      transform: rotate(30deg);
      pointer-events: none;
    }
    
    .add-btn {
      background: rgba(255, 255, 255, 0.15);
      border: 1px solid rgba(255, 255, 255, 0.3);
      color: #fff;
      font-weight: 500;
      padding: 10px 20px;
      border-radius: 6px;
      transition: all 0.3s ease;
      
      &:hover {
        background: rgba(255, 255, 255, 0.25);
        transform: translateY(-2px);
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
      }
      
      &:active {
        transform: translateY(0);
      }
    }
  }
  
  /* 表单样式优化 */
  :deep(.el-form) {
    background: #f9fafc;
    padding: 16px;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.03);
    margin-bottom: 24px;
    
    .el-form-item {
      margin-bottom: 0;
      margin-right: 16px;
    }
    
    .el-input__wrapper,
    .el-select__wrapper {
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
      transition: all 0.3s ease;
      
      &:hover {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
      }
    }
    
    .el-button {
      padding: 10px 20px;
      transition: all 0.3s ease;
      
      &:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
      }
      
      &:active {
        transform: translateY(0);
      }
    }
  }
}

/* 统计信息卡片样式 */
.stats-section {
  margin: 24px 0;
  
  .stats-card {
    display: flex;
    gap: 40px;
    padding: 24px;
    background: linear-gradient(135deg, #f6f9fc 0%, #eef2f7 100%);
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    
    &:hover {
      transform: translateY(-3px);
      box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    }
    
    &::after {
      content: '';
      position: absolute;
      bottom: 0;
      left: 0;
      width: 100%;
      height: 4px;
      background: linear-gradient(90deg, #3a7bd5, #00d2ff);
    }
    
    .stats-item {
      display: flex;
      flex-direction: column;
      align-items: center;
      position: relative;
      padding: 0 20px;
      
      &:not(:last-child)::after {
        content: '';
        position: absolute;
        right: -20px;
        top: 10%;
        height: 80%;
        width: 1px;
        background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.1), transparent);
      }
      
      .stats-label {
        font-size: 15px;
        color: #5e6c84;
        margin-bottom: 10px;
        font-weight: 500;
      }
      
      .stats-number {
        font-size: 28px;
        font-weight: bold;
        transition: all 0.3s ease;
        
        &.primary {
          color: #3a7bd5;
          text-shadow: 0 2px 4px rgba(58, 123, 213, 0.2);
        }
        
        &.success {
          color: #36b37e;
          text-shadow: 0 2px 4px rgba(54, 179, 126, 0.2);
        }
        
        &.warning {
          color: #ff9f43;
          text-shadow: 0 2px 4px rgba(255, 159, 67, 0.2);
        }
      }
    }
  }
}

/* 表格样式优化 */
:deep(.el-table) {
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
  
  .el-table__header-wrapper {
    th {
      background: #f0f5ff;
      color: #3a7bd5;
      font-weight: 600;
      padding: 12px 0;
    }
  }
  
  .el-table__row {
    transition: all 0.2s ease;
    
    &:hover {
      background-color: #f6f9fc !important;
      transform: translateY(-2px);
      box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    }
    
    td {
      padding: 12px 0;
    }
  }
  
  .el-button {
    transition: all 0.2s ease;
    border-radius: 4px;
    padding: 6px 12px;
    
    &:hover {
      transform: translateY(-2px);
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
  }
}

/* 质检指标信息样式 */
.standards-info {
  font-size: 13px;
  line-height: 1.5;
  background: #f9fafc;
  padding: 8px 12px;
  border-radius: 6px;
  border-left: 3px solid #3a7bd5;
  
  div {
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    
    &:before {
      content: '•';
      color: #3a7bd5;
      margin-right: 5px;
      font-weight: bold;
    }
    
    &:last-child {
      margin-bottom: 0;
    }
  }
}

/* 分页控件样式 */
.pagination-container {
  display: flex;
  justify-content: center;
  margin-top: 30px;
  padding: 16px 0;
  
  :deep(.el-pagination) {
    padding: 12px 24px;
    background: #f9fafc;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
    
    .el-pagination__sizes,
    .el-pagination__jump {
      margin-left: 16px;
    }
    
    button {
      background: transparent;
      
      &:hover {
        color: #3a7bd5;
      }
      
      &:disabled {
        background: transparent;
      }
    }
    
    .el-pager li {
      background: transparent;
      transition: all 0.3s ease;
      
      &.is-active {
        background: #3a7bd5;
        color: white;
        font-weight: bold;
      }
      
      &:hover:not(.is-active) {
        color: #3a7bd5;
      }
    }
  }
}

/* 对话框底部按钮样式 */
.dialog-footer {
  text-align: right;
  
  :deep(.el-button) {
    padding: 10px 24px;
    transition: all 0.3s ease;
    border-radius: 6px;
    
    &:hover {
      transform: translateY(-2px);
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }
  }
}

/* 表格操作按钮样式 */
.operation-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  
  .el-button {
    margin: 0;
    padding: 6px 8px;
    min-width: 0;
    font-size: 12px;
    border-radius: 4px;
    transition: all 0.25s ease;
    
    &:hover {
      transform: scale(1.05);
      box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
    }
    
    &:active {
      transform: scale(0.98);
    }
  }
}

/* 对话框样式优化 */
:deep(.el-dialog) {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  
  .el-dialog__header {
    background: linear-gradient(135deg, #3a7bd5 0%, #00d2ff 100%);
    padding: 20px 24px;
    margin-right: 0;
    
    .el-dialog__title {
      color: white;
      font-weight: 600;
      font-size: 18px;
    }
    
    .el-dialog__headerbtn {
      top: 20px;
      right: 20px;
      
      .el-dialog__close {
        color: rgba(255, 255, 255, 0.9);
        
        &:hover {
          color: white;
        }
      }
    }
  }
  
  .el-dialog__body {
    padding: 24px;
  }
  
  .el-dialog__footer {
    padding: 16px 24px 24px;
    border-top: 1px solid #ebeef5;
  }
}

:deep(.el-table) {
  border-radius: 8px;
  overflow: hidden;
  
  .el-table__header {
    background: #f8f9fa;
  }
  
  .el-table__row:hover {
    background: #f5f7fa;
  }
}

:deep(.el-form-item__label) {
  font-weight: 500;
  color: #606266;
}

:deep(.el-button) {
  border-radius: 6px;
  transition: all 0.3s ease;
  
  &:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  }
}

/* 新增标准窗口样式 */
.standard-dialog {
  :deep(.el-dialog__body) {
    padding: 20px 24px;
  }
  
  .standard-form {
    .form-section {
      margin-bottom: 24px;
      background-color: #f9fafc;
      border-radius: 8px;
      padding: 16px;
      box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
      
      &:last-child {
        margin-bottom: 0;
      }
      
      .section-title {
        font-size: 16px;
        font-weight: 600;
        color: #409EFF;
        margin-bottom: 16px;
        padding-bottom: 8px;
        border-bottom: 1px solid #e0e6ed;
        position: relative;
        
        &:before {
          content: '';
          position: absolute;
          left: 0;
          bottom: -1px;
          width: 50px;
          height: 2px;
          background: linear-gradient(90deg, #409EFF, #79bbff);
        }
      }
      
      .el-row {
        margin-bottom: 8px;
        
        &:last-child {
          margin-bottom: 0;
        }
      }
    }
    
    :deep(.el-input__wrapper),
    :deep(.el-select__wrapper) {
      box-shadow: 0 0 0 1px #dcdfe6 inset;
      transition: all 0.2s ease;
      
      &:hover {
        box-shadow: 0 0 0 1px #c0c4cc inset;
      }
      
      &.is-focus {
        box-shadow: 0 0 0 1px #409EFF inset;
      }
    }
    
    :deep(.el-input__prefix) {
      color: #909399;
    }
  }
  
  .full-width {
    width: 100%;
  }
  
  :deep(.el-form-item) {
    margin-bottom: 18px;
  }
}
</style>